<template>
  <div>
    <el-form :model="formInline" :rules="rules">
      <el-form-item label="手机号" prop="SJH">
        <el-input v-model="formInline.SJH" placeholder="手机号" />
      </el-form-item>
      <el-form-item label="密码" prop="password">
        <el-input v-model="formInline.password" placeholder="密码" />
      </el-form-item>
      <el-form-item>
        <el-button type="primary">登录</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
export default {
  data() {
    return {
      formInline: {
        SJH: '',
        password: ''
      },
      rules: {
        SJH: [
          { required: true,
            message: '手机号为必填项',
            trigger: 'blur' }, {
            pattern: '/^1[3-9][0-9]{9}$/', message: '手机号不正确', trigger: 'blur'
          }
        ],
        password: [
          { required: true,
            message: '密码为必填项',
            trigger: 'blur' }, {
            min: 6, max: 9, message: '密码不正确', trigger: 'blur'
          }
        ]
      }
    }
  },
  async created() {
    this.$store.dispatch('user/getProfile')
  },
  methods: {
    onSubmit() {
    //   console.log('登录!')

    }
  }
}
</script>

<style>
</style>
